package rps.client.ui;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class AboutPane extends JPanel implements MouseListener{
	
	private static final long serialVersionUID = 3773456942276205675L;
	JFrame frame;
	
	public AboutPane(JFrame frame){
		super();
		this.frame = frame;
		Dimension fullScreen = new Dimension(getToolkit().getScreenSize());
		frame.setUndecorated(true);
		frame.getContentPane().addMouseListener(this);
		frame.setSize(fullScreen);
		frame.setVisible(true);
		frame.add(this);
	}
	
	@Override
	public void paintComponent(Graphics g){
		super.paintComponent(g);
		Image img = MediaProvider.getMediaProvider().getImage("about");
		this.setBackground(new Color(3,3,3));
		g.drawImage(img, (getWidth()-img.getWidth(this))/2, (getHeight()-img.getHeight(this))/2, this);
	}

	@Override
	public void mouseClicked(MouseEvent e) {}
	@Override
	public void mouseEntered(MouseEvent e) {}
	@Override
	public void mouseExited(MouseEvent e) {}
	@Override
	public void mousePressed(MouseEvent e) {
		frame.dispose();
		}
	@Override
	public void mouseReleased(MouseEvent e) {}
}
